tr td { padding: 0.1in; text-align: center; } tr td pre { padding: 0.1in; text-align: left; }
Nobody likes to do monotonous tasks over and over again (especially not programmers). That's where the for loop comes in. You could write a program like this:
printf("1\n");but that's no fun. The for allows the programmer step back and just say to the computer, "count from 1 to 10, and print each number."
printf("2\n");
printf("3\n");
printf("4\n");
D |
|
QuickBASIC |
DIM I% FOR I% = 1 TO 10 PRINT I% NEXT I% |
Output | 1 2 3 4 5 6 7 8 9 10 |